money=300
commodity=["枕头","吹风机","泡面","毛巾","雨伞"]
commodity_money=[25,88,5,12,20]
cart =[]
shopping_info=[]
shopping_info_money=[]
choice = input("输入商品(Q或q退出):")
while choice != 'q' and choice !='Q':
    for key1,key2 in zip(commodity,commodity_money):
        if choice == key1:
            if money >= key2:
                money -= key2
                cart.append(key1)
                print("恭喜，购买成功！您的卡余额还剩",money)
                shopping_info.append(key1)
                shopping_info_money.append(key2)
                choice = input("输入商品(Q或q退出)")
                break
            else:
                print("穷鬼，钱不够！请到其他超市购买！")
                choice = input("输入商品(Q或q退出)")
                break
    else:
        print("没有这个商品，别瞎弄！")
        choice = input("输入商品(Q或q退出)")
if len(shopping_info_money)==0 and len(shopping_info) == 0:
    print("没有购买物品，无购物小票")
else:
    print()
    print("购物小票：")
    for key3,ke4 in zip(shopping_info,shopping_info_money):
        print(key3,ke4)
